#include <iostream>
#include <iterator>
#include <vector>
#include <algorithm>

using std::cout;
using std::endl;
using std::ostream_iterator;
using std::vector;
using std::copy;

//输入输出流可以当容器看待，就可以存数据
//operator<<
void test()
{
    vector<int> vec = {1, 3, 5, 7, 9};

    ostream_iterator<int> osi(cout, "\n");

    /* cout << 1 << endl; */
    /* cout.operator<<(1); */

    copy(vec.begin(), vec.end(), osi);
}

int main(int argc, char *argv[])
{
    test();
    return 0;
}

